package com.wst.log4j2;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Log4j2Demo {

    private static final Logger logger =
            LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
//            LogManager.getLogger("log4j2.xml");
    //此方式行不通
     // LogManager.getLogger(Log4j2Demo.class.getName());

    public static void main(String[] args) {
        logger.trace("trace message");
        logger.debug("debug message");
        logger.info("info message");
        logger.warn("warn message");
        logger.error("error message");
        logger.fatal("fatal message");
    }
}
